Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error translation support for std::io::Error #2840

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Add error translation support for std::io::Error #2840

merged 2 commits into from
Feb 12, 2024

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Feb 10, 2024

This simplifies error propagation on Windows when using the Rust standard library for I/O but need rich Windows error propagation. For example:

use std::fs::File;
use std::io::Write;

fn main() -> windows_core::Result<()> {
    let mut f = File::create("test.txt")?;
    f.write_all(&[b'R', b'u', b's', b't'])?;

    Ok(())
}

@kennykerr kennykerr merged commit ed2ef0d into master Feb 12, 2024
65 checks passed
@kennykerr kennykerr deleted the io_error branch February 12, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants